using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Xeml.Document;
using Mpi.Common.Graphic;

namespace Xid.Controls
{
    public partial class OlC_PartitionCtrl : OlC_BaseCtrl
    {
     

        private Partition part;

        public Partition Partition
        {
            get { return part; }
            set 
            { 
                part = value;
                if (part != null)
                {
                    label1.DataBindings.Add("Text", part, "Id");
                    foreach (Term m in part.Material)
                    {
                        listViewMaterial.Items.Add(m.Name).ToolTipText = m.Name;
                    }
                }
            }
        }
	
        public OlC_PartitionCtrl()
        {
            InitializeComponent();
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            this.BackColor = Color.Transparent;
            
        }

        //protected override void OnPaint(PaintEventArgs e)
        //{
        //    Graphics g = e.Graphics;
        //    g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
        //    g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;


        //    g.FillPath(Brushes.PapayaWhip, GraphicEffect.RoundRect(0, 0, (this.Width - 1), (this.Height - 1), 4f));
        //    g.DrawPath(Pens.Black, GraphicEffect.RoundRect(0, 0, (this.Width - 1), (this.Height - 1), 4f));

        //    base.OnPaint(e);
        //}

        //private void olC_SampleCtrl1_Load(object sender, EventArgs e)
        //{

        //}

        //private void OlC_PartitionCtrl_Load(object sender, EventArgs e)
        //{

        //}
    }
}
